<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
	<head>
		<base href="<%=basePath%>">
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="renderer" content="webkit">
  		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<title>金泰物业</title>
		<link rel="stylesheet" type="text/css" href="js/layui-v2.1.5/layui/css/layui.css"/>
		<link rel="stylesheet" href="js/font-awesome/css/font-awesome.min.css">
		<link rel="stylesheet" type="text/css"
	href="js/malihu-custom-scrollbar-plugin-master/jquery.mCustomScrollbar.min.css">
		<link rel="stylesheet" href="static/index.css">
		<!-- favicon 图标 -->
		<link rel="shortcut icon" href="images/favicon.ico">
	</head>
	<body>
		<div class="layui-layout layui-layout-admin kit-layout-admin">
			<!-- 头部 -->
			<div class="layui-header">
	            <div class="layui-logo my-logo"><a href="indexServer" target="_blank"><img src="images/logo-pic.png"></a></div>
	            <ul class="layui-nav layui-layout-right kit-nav">
	            <li class="layui-nav-item"><a href="indexServer.jsp"><i class="fa fa-arrow-circle-o-left" aria-hidden="true"></i> 返回</a></li>
	            <li class="layui-nav-item"><a href="javascript:;" onclick="toPendingList(0)"><i class="fa fa-sign-out" aria-hidden="true">已审批：<span id="toPandingPassCount">0</span></i> </a></li>
	            <li class="layui-nav-item"><a href="javascript:;" onclick="toPendingList(1)"><i class="fa fa-sign-out" aria-hidden="true">已退回：<span id="toPandingBackCount">0</span></i> </a></li>
	            <li class="layui-nav-item"><a href="javascript:;" onclick="toPendingList(2)"><i class="fa fa-sign-out" aria-hidden="true">待审批：<span id="toPandingCount">0</span></i> </a></li>
	                <li class="layui-nav-item">
	                    <a href="javascript:;">
	                        <img src="http://m.zhengjinfan.cn/images/0.jpg" class="layui-nav-img">
	                        <shiro:principal property="userName"></shiro:principal>
	                    </a>
	                    <dl class="layui-nav-child">
	                        <dd><a href="javascript:;">基本资料</a></dd>
	                        <dd><a href="javascript:;">安全设置</a></dd>
	                    </dl>
	                </li>
	                <li class="layui-nav-item"><a href="logout"><i class="fa fa-sign-out" aria-hidden="true"></i> 注销</a></li>
	            </ul>
	        </div>
	        <!-- 侧边栏 -->
	        <div class="layui-side layui-bg-black slideBox1" style='width:160px'>
	        	<div class="layui-side-scroll">
	        		<!-- bar -->
	        		<div class="layui-nav-item layui-nav-title" style="height:45px;text-align:center">
			            <i class="fa fa-bars  barnav1"></i>
			        </div>
	        		<ul class="layui-nav layui-nav-tree left_menu_ul my-nav1">
						<c:forEach items="${requestScope.projectTypeList }" var="t" >
							<li class="layui-nav-item">
								<!-- 获取项目分类列表，判断显示图标 -->
								<a href="javascript:;">
									<c:choose>
										<c:when test='${pageScope.t eq "居住场所" }'>
											<i class="fa fa-home fa-lg"></i>
										</c:when>
										<c:when test='${pageScope.t eq "商业综合" }'>
											<i class="fa fa-database fa-fw"></i>
										</c:when>
										<c:when test='${pageScope.t eq "教育场所" }'>
											<i class="fa fa-mortar-board fa-fw"></i>
										</c:when>
										<c:when test='${pageScope.t eq "工业园区" }'>
											<i class="fa fa-industry fa-fw"></i>
										</c:when>
										<c:when test='${pageScope.t eq "行政办公" }'>
											<i class="fa fa-handshake-o fa-fw"></i>
										</c:when>
										<c:when test='${pageScope.t eq "交通枢纽" }'>
											<i class="fa fa-bus fa-fw"></i>
										</c:when>
										<c:when test='${pageScope.t eq "文博场所" }'>
											<i class="fa fa-university fa-fw"></i>
										</c:when>
										<c:when test='${pageScope.t eq "养老医疗" }'>
											<i class="fa fa-medkit fa-fw"></i>
										</c:when>
									</c:choose>
								<span>${pageScope.t }</span>
								</a>
								<!-- 根据项目分类输出改分类下的所有项目 -->
								<dl class="layui-nav-child">
								<c:forEach items="${requestScope.projectInfoList }" var="t1" >
									<c:if test="${pageScope.t1.projectType==pageScope.t }">
								    	<dd id-data="${pageScope.t1.id }" >
								    		<a href="javascript:;">${pageScope.t1.projectName }
								    			<shiro:hasPermission name="permission:edit"> 
								    				<i class="fa fa-edit fa-fw"></i>
								    			</shiro:hasPermission> 
								    		</a>
								    		
								    		
								    	</dd>
									</c:if>
							    </c:forEach>
							  	</dl>
							</li>
						</c:forEach>
		            </ul>
					<div class='my-add'>
						<i id="addP" class="layui-icon">&#xe654;</i>
					</div>
	        	</div>
	        </div>
	         <!-- 侧边栏 -->
			<div class="layui-side layui-bg-black my-nav2" style="width: 0px;left:160px" >
	        	<div class="layui-side-scroll">
	        		<!-- bar -->
	        		<div id="sidebar" class="sidebar-fold">
	        			<i class="layui-icon my-icon bar-icon">&#xe603;</i>
	        		</div>
					<ul class="layui-nav layui-nav-tree layui-bg-black layui-inline" lay-filter="demo">
					  <li class="layui-nav-item layui-this" src-data="houseIndex/toHouseIndex">
					    <a href="javascript:;"><i class="layui-icon my-icon">&#xe68e;</i>总体说明</a>
					  </li>
					  
					  <li class="layui-nav-item " src-data="houseIndex/toCustomerIndex">
					    <a href="javascript:;"><i class="layui-icon my-icon">&#xe68e;</i>客户关系</a>
					    <dl class="layui-nav-child" >
					    	<dd src-data="customerInfo/toCustomerIndex">
					    		<a href="javascript:;"><i class="layui-icon my-icon">&#xe68e;</i>客户关系</a>
					    	</dd>
					    	<dd src-data="customerInfo/toHistoryCustomerIndex">
					    		<a href="javascript:;"><i class="layui-icon my-icon">&#xe68e;</i>历史客户</a>
					    	</dd>
					    </dl>
					  </li>
					  <!-- <li class="layui-nav-item">
					    <a href="javascript:;"><i class="layui-icon my-icon">&#xe68e;</i>预留菜单</a>
					    <dl class="layui-nav-child">
					      <dd src-data="houseIndex/toHouseIndex1" ><a href="javascript:;">子菜单1</a></dd>
					      <dd src-data="houseIndex/toHouseIndex1" ><a href="javascript:;">子菜单2</a></dd>
					    </dl>
					  </li> -->
					</ul>
	        	</div>
	        </div>
	        <div class="layui-body iframe-container my-body" style="left:160px">
	        	<div class="iframe-title">
					<div class='title-txt'><span class="txt"><i class="layui-icon my-icon"></i>总体说明</span></div>
	        	</div>
				<div class='iframe-content'>
					 <iframe src="" frameborder="0" style="width:100%;height:100%;display: block;">
						
					</iframe> 
					
				</div>
		    </div>
		</div>
	</body>
	<script type="text/javascript" src="js/jquery-1.11.1.js" ></script>
	<script src="js/layui-v2.1.5/layui/layui.js"></script>
	<script type="text/javascript" src="js/layui-v2.1.5/layui/layui.all.js" ></script>
	<script type="text/javascript" src="js/malihu-custom-scrollbar-plugin-master/jquery.mCustomScrollbar.concat.min.js"></script>
	<script src='static/index.js'></script>
	<script >
	$(function(){
		getPendingCount();
		getPendingPassCount();
		getPendingBackCount();
	});
	function getPendingCount(){
		$.ajax({
			url : "customerInfo/getPendingCount", //请求的url地址
			dataType : "json", //返回格式为json
			async : true, //请求是否异步，默认为异步，这也是ajax重要特性 false:同步  true：异步
			type : "post", //请求方式
			success : function(data) {
				$("#toPandingCount").text(data);
				
			}
		});
	}
	//已审批
	function getPendingPassCount(){
		$.ajax({
			url : "customerInfo/getPendingPassCount", //请求的url地址
			dataType : "json", //返回格式为json
			async : true, //请求是否异步，默认为异步，这也是ajax重要特性 false:同步  true：异步
			type : "post", //请求方式
			success : function(data) {
				$("#toPandingPassCount").text(data);
				
			}
		});
	}
	//已退回
	function getPendingBackCount(){
		$.ajax({
			url : "customerInfo/getPendingBackCount", //请求的url地址
			dataType : "json", //返回格式为json
			async : true, //请求是否异步，默认为异步，这也是ajax重要特性 false:同步  true：异步
			type : "post", //请求方式
			success : function(data) {
				$("#toPandingBackCount").text(data);
				
			}
		});
	}
	//state 审批状态  2审批中 1 退回 0审批通过
	//跳转待审批列表
	function toPendingList(state){
		var layerTitle = '待审批列表';
		if(state==1){
			layerTitle='已退回列表';
		}else if(state==0){
			layerTitle='已审批列表';
		}
		layer.open({
			title: layerTitle,
			type: 2,
			area: ['90%', '80%'],
			fix: false, //不固定
			maxmin: true,
			content: "customerInfo/toPendingList/"+state,
			
		});
	
	}
	
	</script>
</html>
